package geo.obj;

import geo.ani.IAnisotropy;

import java.awt.Color;
import java.awt.Polygon;

import gui.panels.*;

public class Domain {
	private int _height = 500;
	private int _width = 500;
	private Color _background = Color.BLACK;
	private Color _netcolor = Color.lightGray;
	private Color _axiscolor = Color.BLACK;
	
	public Color get_axiscolor() {
		return _axiscolor;
	}

	public void set_axiscolor(Color _axiscolor) {
		this._axiscolor = _axiscolor;
	}

	private int _netspacing = 20;
	IAnisotropy _unnamed_IAnisotropy_;
	DomainDrawPanel _unnamed_DomainDrawPanel_;

	public boolean setAnisotropyType(int aN) {
		throw new UnsupportedOperationException();
	}

	public double culcSpace() {
		return _height * _width;
	}

	public void setHeight(int aHeight) {
		this._height = aHeight;
	}

	public int getHeight() {
		return this._height;
	}

	public void setWidth(int aWidth) {
		this._width = aWidth;
	}

	public int getWidth() {
		return this._width;
	}

	public void setBackground(Color aBackground) {
		this._background = aBackground;
	}

	public Color getBackground() {
		return this._background;
	}

	public void setNetcolor(Color aNetcolor) {
		this._netcolor = aNetcolor;
	}

	public Color getNetcolor() {
		return this._netcolor;
	}

	public void setNetspacing(int aNetspacing) {
		this._netspacing = aNetspacing;
	}

	public int getNetspacing() {
		return this._netspacing;
	}
	
	public boolean inside(PhiObject p, int br){
		int xf[] = {br, br + _width+br, br + _width+br, br};
		int yd[] = {br, br, br + _height+br+br, br + _height+br+br};
		Polygon s0 = new Polygon(xf, yd, 4);
		for(int i = 0; i < p.size(); i++){
			if(!s0.contains(p.getIntX()[i], p.getIntY()[i])) return false;
		}
		return true;
		
	}
}